﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="get_exam.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Class.get_exam" %>
<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <%
        string id = Request.QueryString["id"];
        var get_exam = new TblExamController().FetchAll().ToList();
        if(id!="")
            get_exam = new TblExamController().FetchAll().Where(x => x.ExamGroup == int.Parse(id)).ToList();
        else
        {
            var get_group = new TblExamGroupController().FetchAll().First();
            get_exam = new TblExamController().FetchAll().Where(x => x.ExamGroup == get_group.GroupId).ToList();
        }
        


        for (int i=0;i<get_exam.Count;i++)
        {%>
            <option value="<%=get_exam[i].ExamId %>"><%=get_exam[i].ExamName %></option>
    <%} %>
</body>
</html>
